package com.fenghongzhang.aidl_server;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;

public class MyService extends Service {
    public MyService() {
    }


    //返回给客户端的对象. 其实客户端也有个对象.
   IMyAidlInterface.Stub stub =  new IMyAidlInterface.Stub(){
       @Override
       public int add(int a, int b) throws RemoteException {
           return a+b;
       }
   };

    @Override
    public IBinder onBind(Intent intent) {
        return stub;
    }
}
